import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86156
 * Date: 2023-04-08
 * Time: 18:09
 */
public class user {
    public static void main(String[] args) {
        String username = "zhangsan";
        String password = "123456";

        for (int i=0;i<3;i++) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入用户名和密码");
            String s1 = scanner.next();
            String s2 = scanner.next();
            if(username.equals(s1)&&password.equals(s2)){
                System.out.println("登陆成功");
            }else{
                System.out.println("用户名或密码错误,请重新输入,还有"+(2-i)+"次机会");
            }
        }
    }
}
